package test;

import static net.ftng.commons.lang.utils.PrintUtils.println;

import java.util.ArrayList;

public class Store extends ArrayList<Aisle> {

    private static final long serialVersionUID = 6170230575956396503L;

    public Store(final Integer numberOfAisle, final Integer numberOfShelf,
            final Integer numberOfProduces) {

        for (int i = 0; i < numberOfAisle; i++) {
            add(new Aisle(numberOfShelf, numberOfProduces));
        }
    }

    @Override
    public String toString() {

        StringBuilder sb = new StringBuilder();
        for (Aisle aisle : this) {
            for (Shelf shelf : aisle) {
                for (Produce produce : shelf) {
                    sb.append(String.format("%s\n", produce));
                }
            }
        }
        return sb.toString();
    }

    public static void main(final String[] args) {

        Store store = new Store(3, 2, 20);
        println(store);
    }
}
